/*     */ package com.yc.dao.station;
/*     */ 
/*     */ import btsm.bean.dbConnector;
/*     */ import com.yc.dao.model.TransfersBO;
/*     */ import com.yc.dao.model.TransferscircuitBO;
/*     */ import com.yc.util.FormateSQL;
/*     */ import com.yc.util.ListContentsBFO;
/*     */ import java.sql.ResultSet;
/*     */ import java.text.SimpleDateFormat;
/*     */ import java.util.ArrayList;
/*     */ import java.util.Date;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import org.apache.commons.logging.Log;
/*     */ import org.apache.commons.logging.LogFactory;
/*     */ 
/*     */ public class TransfersDAO
/*     */ {
/*  23 */   private static final Log log = LogFactory.getLog(TransfersDAO.class);
/*  24 */   private SimpleDateFormat fresh = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
/*  25 */   private dbConnector dbcon = null;
/*     */ 
/*  27 */   private void dbConInit() { if (this.dbcon == null)
/*  28 */       this.dbcon = new dbConnector(); }
/*     */ 
/*     */   private void dbConClose()
/*     */   {
/*  32 */     if (this.dbcon != null)
/*  33 */       this.dbcon.closeAll();
/*  34 */     this.dbcon = null;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getTransfersList(Map condition)
/*     */   {
/*  39 */     ListContentsBFO bfo = new ListContentsBFO();
/*  40 */     int start = Integer.parseInt(condition.get("start").toString());
/*  41 */     int limit = Integer.parseInt(condition.get("limit").toString());
/*  42 */     String strBtscode = condition.get("BTS_CODE").toString();
/*  43 */     ResultSet rs = null;
/*  44 */     List list = new ArrayList();
/*     */     try
/*     */     {
/*  47 */       dbConInit();
/*  48 */       String strSQL = " select count(id) from transfers where btscode = '" + strBtscode + "' ";
/*  49 */       log.info(strSQL);
/*  50 */       rs = this.dbcon.execQuery(strSQL);
/*  51 */       if (rs.next()) {
/*  52 */         bfo.setTotalSize(rs.getInt(1));
/*     */       }
/*  54 */       strSQL = " select * from transfers where btscode ='" + strBtscode + "' limit " + start + ", " + limit;
/*  55 */       log.info(strSQL);
/*  56 */       rs = this.dbcon.execQuery(strSQL);
/*  57 */       while (rs.next()) {
/*  58 */         TransfersBO bo = new TransfersBO();
/*  59 */         bo.setId(rs.getString("id"));
/*  60 */         bo.setBtscode(rs.getString("btscode"));
/*  61 */         bo.setBtsname(rs.getString("btsname"));
/*  62 */         bo.setTransAF(rs.getString("transAF"));
/*  63 */         bo.setSDHAF(rs.getString("SDHAF"));
/*  64 */         bo.setPDHAF(rs.getString("PDHAF"));
/*  65 */         bo.setMicrowaveAF(rs.getString("microwaveAF"));
/*  66 */         bo.setOtherAF(rs.getString("otherAF"));
/*  67 */         bo.setSDHAM(rs.getString("SDHAM"));
/*  68 */         bo.setPDHAM(rs.getString("PDHAM"));
/*  69 */         bo.setMicrowaveAM(rs.getString("microwaveAM"));
/*  70 */         bo.setOtherAM(rs.getString("otherAM"));
/*  71 */         bo.setVoltageA(rs.getString("voltageA"));
/*  72 */         bo.setPropertyA(rs.getString("propertyA"));
/*  73 */         bo.setOpentimeA(rs.getDate("opentimeA"));
/*  74 */         bo.setDistODFAF(rs.getString("distODFAF"));
/*  75 */         bo.setDistDDFAF(rs.getString("distDDFAF"));
/*  76 */         bo.setDistcomtankAF(rs.getString("distcomtankAF"));
/*  77 */         bo.setDistotherAF(rs.getString("distotherAF"));
/*  78 */         bo.setDistODFAM(rs.getString("distODFAM"));
/*  79 */         bo.setDistDDFAM(rs.getString("distDDFAM"));
/*  80 */         bo.setDistcomtankAM(rs.getString("distcomtankAM"));
/*  81 */         bo.setDistotherAM(rs.getString("distotherAM"));
/*  82 */         bo.setEle2MCNum(rs.getString("ele2MCNum"));
/*  83 */         bo.setEle2MUNum(rs.getString("ele2MUNum"));
/*  84 */         bo.setEle2MAUNum(rs.getString("ele2MAUNum"));
/*  85 */         bo.setEle2MUidx(rs.getString("ele2MUidx"));
/*  86 */         bo.setEle2MUTimeSlot(rs.getString("ele2MUTimeSlot"));
/*  87 */         bo.setMaintenance(rs.getString("maintenance"));
/*  88 */         bo.setRefreshtime(rs.getDate("refreshtime"));
/*  89 */         bo.setMemo(rs.getString("memo"));
/*  90 */         bo.setStr2MUseSta(rs.getString("2MUseSta"));
/*  91 */         bo.setIsPowerAlone(rs.getString("isPowerAlone"));
/*  92 */         bo.setMemo(rs.getString("memo"));
/*  93 */         bo.setPortid(rs.getString("portid"));
/*  94 */         bo.setUseinfo(rs.getString("useinfo"));
/*  95 */         list.add(bo);
/*     */       }
/*  97 */       bfo.setData(list.toArray());
/*     */     }
/*     */     catch (Exception e) {
/* 100 */       e.printStackTrace();
/* 101 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 104 */       dbConClose();
/*     */     }
/* 106 */     return bfo;
/*     */   }
/*     */ 
/*     */   public boolean saveTransfersBO(TransfersBO bo)
/*     */   {
/* 112 */     log.info("添加--传输---开始");
/* 113 */     boolean flag = true;
/*     */     try
/*     */     {
/* 116 */       dbConInit();
/* 117 */       StringBuffer sqlBuf = new StringBuffer();
/* 118 */       sqlBuf.append(" insert into transfers ( btscode,  btsname, transAF, SDHAF,");
/* 119 */       sqlBuf.append(" PDHAF, microwaveAF, otherAF, SDHAM, PDHAM,  microwaveAM, otherAM,");
/* 120 */       sqlBuf.append(" voltageA, propertyA, opentimeA, distODFAF, distDDFAF, distcomtankAF,");
/* 121 */       sqlBuf.append(" distotherAF, distODFAM, distDDFAM,  distcomtankAM, distotherAM,");
/* 122 */       sqlBuf.append(" ele2MCNum, ele2MUNum, ele2MAUNum, ele2MUidx,  ele2MUTimeSlot,  maintenance,");
/* 123 */       sqlBuf.append(" refreshtime, memo, 2MUseSta, portid,useinfo, isPowerAlone,registtime ) values ( ");
/* 124 */       sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/* 125 */       sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/* 126 */       sqlBuf.append(" '" + bo.getTransAF() + "' ,");
/* 127 */       sqlBuf.append(" '" + bo.getSDHAF() + "' ,");
/* 128 */       sqlBuf.append(" '" + bo.getPDHAF() + "' ,");
/* 129 */       sqlBuf.append(" '" + bo.getMicrowaveAF() + "' ,");
/* 130 */       sqlBuf.append(" '" + bo.getOtherAF() + "' ,");
/* 131 */       sqlBuf.append(" '" + bo.getSDHAM() + "' ,");
/* 132 */       sqlBuf.append(" '" + bo.getPDHAM() + "' ,");
/* 133 */       sqlBuf.append(" '" + bo.getMicrowaveAM() + "' ,");
/* 134 */       sqlBuf.append(" '" + bo.getOtherAM() + "' ,");
/* 135 */       sqlBuf.append(" '" + bo.getVoltageA() + "' ,");
/* 136 */       sqlBuf.append(" '" + bo.getPropertyA() + "' ,");
/* 137 */       sqlBuf.append(" '" + this.fresh.format(bo.getOpentimeA()) + "' ,");
/* 138 */       sqlBuf.append(" '" + bo.getDistODFAF() + "' ,");
/* 139 */       sqlBuf.append(" '" + bo.getDistDDFAF() + "' ,");
/* 140 */       sqlBuf.append(" '" + bo.getDistcomtankAF() + "' ,");
/* 141 */       sqlBuf.append(" '" + bo.getDistotherAF() + "' ,");
/* 142 */       sqlBuf.append(" '" + bo.getDistODFAM() + "' ,");
/* 143 */       sqlBuf.append(" '" + bo.getDistDDFAM() + "' ,");
/* 144 */       sqlBuf.append(" '" + bo.getDistcomtankAM() + "' ,");
/* 145 */       sqlBuf.append(" '" + bo.getDistotherAM() + "' ,");
/* 146 */       sqlBuf.append(" '" + bo.getEle2MCNum() + "' ,");
/* 147 */       sqlBuf.append(" '" + bo.getEle2MUNum() + "' ,");
/* 148 */       sqlBuf.append(" '" + bo.getEle2MAUNum() + "' ,");
/* 149 */       sqlBuf.append(" '" + bo.getEle2MUidx() + "' ,");
/* 150 */       sqlBuf.append(" '" + bo.getEle2MUTimeSlot() + "' ,");
/* 151 */       sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/* 152 */       sqlBuf.append(" '" + this.fresh.format(new Date()) + "' ,");
/* 153 */       sqlBuf.append(" '" + bo.getMemo() + "' ,");
/* 154 */       sqlBuf.append(" '" + bo.getStr2MUseSta() + "' ,");
/* 155 */       sqlBuf.append(" '" + bo.getPortid() + "' ,");
/* 156 */       sqlBuf.append(" '" + bo.getUseinfo() + "' ,");
/* 157 */       sqlBuf.append(" '" + bo.getIsPowerAlone() + "' ,");
/* 158 */       sqlBuf.append(" '" + this.fresh.format(new Date()) + "' )");
/* 159 */       log.info(sqlBuf.toString());
/* 160 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 164 */       flag = false;
/* 165 */       e.printStackTrace();
/* 166 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 169 */       dbConClose();
/*     */     }
/* 171 */     log.info("添加--传输---结束");
/* 172 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean updateTransfersBO(TransfersBO bo)
/*     */   {
/* 177 */     log.info("修改--传输---开始");
/* 178 */     boolean flag = true;
/*     */     try
/*     */     {
/* 181 */       dbConInit();
/* 182 */       StringBuffer sqlBuf = new StringBuffer();
/* 183 */       sqlBuf.append(" update transfers set ");
/* 184 */       sqlBuf.append(" transAF = '" + bo.getTransAF() + "' ,");
/* 185 */       sqlBuf.append(" SDHAF = '" + bo.getSDHAF() + "' ,");
/* 186 */       sqlBuf.append(" PDHAF = '" + bo.getPDHAF() + "' ,");
/* 187 */       sqlBuf.append(" microwaveAF = '" + bo.getMicrowaveAF() + "' ,");
/* 188 */       sqlBuf.append(" otherAF = '" + bo.getOtherAF() + "' ,");
/* 189 */       sqlBuf.append(" SDHAM = '" + bo.getSDHAM() + "' ,");
/* 190 */       sqlBuf.append(" PDHAM = '" + bo.getPDHAM() + "' ,");
/* 191 */       sqlBuf.append(" microwaveAM = '" + bo.getMicrowaveAM() + "' ,");
/* 192 */       sqlBuf.append(" otherAM = '" + bo.getOtherAM() + "' ,");
/* 193 */       sqlBuf.append(" voltageA = '" + bo.getVoltageA() + "' ,");
/* 194 */       sqlBuf.append(" propertyA = '" + bo.getPropertyA() + "' ,");
/* 195 */       sqlBuf.append(" opentimeA = '" + this.fresh.format(bo.getOpentimeA()) + "' ,");
/* 196 */       sqlBuf.append(" distODFAF = '" + bo.getDistODFAF() + "' ,");
/* 197 */       sqlBuf.append(" distDDFAF = '" + bo.getDistDDFAF() + "' ,");
/* 198 */       sqlBuf.append(" distcomtankAF = '" + bo.getDistcomtankAF() + "' ,");
/* 199 */       sqlBuf.append(" distotherAF = '" + bo.getDistotherAF() + "' ,");
/* 200 */       sqlBuf.append(" distODFAM = '" + bo.getDistODFAM() + "' ,");
/* 201 */       sqlBuf.append(" distDDFAM = '" + bo.getDistDDFAM() + "' ,");
/* 202 */       sqlBuf.append(" distcomtankAM = '" + bo.getDistcomtankAM() + "' ,");
/* 203 */       sqlBuf.append(" distotherAM = '" + bo.getDistotherAM() + "' ,");
/* 204 */       sqlBuf.append(" ele2MCNum = '" + bo.getEle2MCNum() + "' ,");
/* 205 */       sqlBuf.append(" ele2MUNum = '" + bo.getEle2MUNum() + "' ,");
/* 206 */       sqlBuf.append(" ele2MAUNum = '" + bo.getEle2MAUNum() + "' ,");
/* 207 */       sqlBuf.append(" ele2MUidx = '" + bo.getEle2MUidx() + "' ,");
/* 208 */       sqlBuf.append(" ele2MUTimeSlot = '" + bo.getEle2MUTimeSlot() + "' ,");
/* 209 */       sqlBuf.append(" maintenance = '" + bo.getMaintenance() + "' ,");
/* 210 */       sqlBuf.append(" refreshtime = '" + this.fresh.format(new Date()) + "' ,");
/* 211 */       sqlBuf.append(" memo = '" + bo.getMemo() + "' ,");
/* 212 */       sqlBuf.append(" 2MUseSta = '" + bo.getStr2MUseSta() + "' ,");
/* 213 */       sqlBuf.append(" portid = '" + bo.getPortid() + "' ,");
/* 214 */       sqlBuf.append(" useinfo = '" + bo.getUseinfo() + "' ,");
/* 215 */       sqlBuf.append(" isPowerAlone = '" + bo.getIsPowerAlone() + "'  ");
/* 216 */       sqlBuf.append(" where id = '" + bo.getId() + "'");
/* 217 */       log.info(sqlBuf.toString());
/* 218 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 222 */       flag = false;
/* 223 */       e.printStackTrace();
/* 224 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 227 */       dbConClose();
/*     */     }
/* 229 */     log.info("修改--传输---结束");
/* 230 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean deleteTransfersBO(String strID)
/*     */   {
/* 235 */     log.info("删除--传输---开始");
/* 236 */     boolean flag = true;
/*     */     try
/*     */     {
/* 239 */       dbConInit();
/* 240 */       StringBuffer sqlBuf = new StringBuffer();
/* 241 */       sqlBuf.append(" delete from transfers  ");
/* 242 */       sqlBuf.append(" where id = '" + strID + "'");
/* 243 */       log.info(sqlBuf.toString());
/* 244 */       this.dbcon.execUpdate(sqlBuf.toString());
/* 245 */       this.dbcon.execUpdate(" delete from transferscircuit where transfersid = '" + strID + "' ");
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 249 */       flag = false;
/* 250 */       e.printStackTrace();
/* 251 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 254 */       dbConClose();
/*     */     }
/* 256 */     log.info("删除--传输---结束");
/* 257 */     return flag;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getTransfersByBtsName(Map condition)
/*     */   {
/* 262 */     ListContentsBFO bfo = new ListContentsBFO();
/* 263 */     int start = Integer.parseInt(condition.get("start").toString());
/* 264 */     int limit = Integer.parseInt(condition.get("limit").toString());
/* 265 */     String strBtsName = condition.get("btsName").toString();
/* 266 */     ResultSet rs = null;
/* 267 */     List list = new ArrayList();
/*     */     try
/*     */     {
/* 270 */       dbConInit();
/*     */ 
/* 272 */       Object objRegistBeginTime = condition.get("registBeginTime");
/* 273 */       Object objRegistEndTime = condition.get("registEndTime");
/* 274 */       String strSQL = " select count(id) from transfers where btsname like '%" + strBtsName + "%' ";
/* 275 */       strSQL = FormateSQL.getFormateSQL(objRegistBeginTime, objRegistEndTime, strSQL);
/* 276 */       log.info(strSQL);
/* 277 */       rs = this.dbcon.execQuery(strSQL);
/* 278 */       if (rs.next()) {
/* 279 */         bfo.setTotalSize(rs.getInt(1));
/*     */       }
/* 281 */       strSQL = " select * from transfers where  btsname like '%" + strBtsName + "%' ";
/* 282 */       strSQL = FormateSQL.getFormateSQL(objRegistBeginTime, objRegistEndTime, strSQL);
/* 283 */       strSQL = strSQL + "limit " + start + ", " + limit;
/* 284 */       log.info(strSQL);
/* 285 */       rs = this.dbcon.execQuery(strSQL);
/* 286 */       while (rs.next()) {
/* 287 */         TransfersBO bo = new TransfersBO();
/* 288 */         bo.setId(rs.getString("id"));
/* 289 */         bo.setBtscode(rs.getString("btscode"));
/* 290 */         bo.setBtsname(rs.getString("btsname"));
/* 291 */         bo.setTransAF(rs.getString("transAF"));
/* 292 */         bo.setSDHAF(rs.getString("SDHAF"));
/* 293 */         bo.setPDHAF(rs.getString("PDHAF"));
/* 294 */         bo.setMicrowaveAF(rs.getString("microwaveAF"));
/* 295 */         bo.setOtherAF(rs.getString("otherAF"));
/* 296 */         bo.setSDHAM(rs.getString("SDHAM"));
/* 297 */         bo.setPDHAM(rs.getString("PDHAM"));
/* 298 */         bo.setMicrowaveAM(rs.getString("microwaveAM"));
/* 299 */         bo.setOtherAM(rs.getString("otherAM"));
/* 300 */         bo.setVoltageA(rs.getString("voltageA"));
/* 301 */         bo.setPropertyA(rs.getString("propertyA"));
/* 302 */         bo.setOpentimeA(rs.getDate("opentimeA"));
/* 303 */         bo.setDistODFAF(rs.getString("distODFAF"));
/* 304 */         bo.setDistDDFAF(rs.getString("distDDFAF"));
/* 305 */         bo.setDistcomtankAF(rs.getString("distcomtankAF"));
/* 306 */         bo.setDistotherAF(rs.getString("distotherAF"));
/* 307 */         bo.setDistODFAM(rs.getString("distODFAM"));
/* 308 */         bo.setDistDDFAM(rs.getString("distDDFAM"));
/* 309 */         bo.setDistcomtankAM(rs.getString("distcomtankAM"));
/* 310 */         bo.setDistotherAM(rs.getString("distotherAM"));
/* 311 */         bo.setEle2MCNum(rs.getString("ele2MCNum"));
/* 312 */         bo.setEle2MUNum(rs.getString("ele2MUNum"));
/* 313 */         bo.setEle2MAUNum(rs.getString("ele2MAUNum"));
/* 314 */         bo.setEle2MUidx(rs.getString("ele2MUidx"));
/* 315 */         bo.setEle2MUTimeSlot(rs.getString("ele2MUTimeSlot"));
/* 316 */         bo.setMaintenance(rs.getString("maintenance"));
/* 317 */         bo.setRefreshtime(rs.getDate("refreshtime"));
/* 318 */         bo.setMemo(rs.getString("memo"));
/* 319 */         bo.setStr2MUseSta(rs.getString("2MUseSta"));
/* 320 */         bo.setIsPowerAlone(rs.getString("isPowerAlone"));
/* 321 */         bo.setMemo(rs.getString("memo"));
/* 322 */         bo.setPortid(rs.getString("portid"));
/* 323 */         bo.setUseinfo(rs.getString("useinfo"));
/* 324 */         list.add(bo);
/*     */       }
/* 326 */       bfo.setData(list.toArray());
/*     */     }
/*     */     catch (Exception e) {
/* 329 */       e.printStackTrace();
/* 330 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 333 */       dbConClose();
/*     */     }
/* 335 */     return bfo;
/*     */   }
/*     */ 
/*     */   public List export(String strBtsName, String strRegistBeginTime, String strRegistEndTime)
/*     */   {
/* 341 */     ResultSet rs = null;
/* 342 */     List list = new ArrayList();
/*     */     try
/*     */     {
/* 345 */       dbConInit();
/* 346 */       String strSQL = " select * from transfers where  btsname like '%" + strBtsName + "%' ";
/* 347 */       strSQL = FormateSQL.getFormateSQL(strRegistBeginTime, strRegistEndTime, strSQL);
/* 348 */       log.info(strSQL);
/* 349 */       rs = this.dbcon.execQuery(strSQL);
/* 350 */       while (rs.next()) {
/* 351 */         TransfersBO bo = new TransfersBO();
/* 352 */         bo.setId(rs.getString("id"));
/* 353 */         bo.setBtscode(rs.getString("btscode"));
/* 354 */         bo.setBtsname(rs.getString("btsname"));
/* 355 */         bo.setTransAF(rs.getString("transAF"));
/* 356 */         bo.setSDHAF(rs.getString("SDHAF"));
/* 357 */         bo.setPDHAF(rs.getString("PDHAF"));
/* 358 */         bo.setMicrowaveAF(rs.getString("microwaveAF"));
/* 359 */         bo.setOtherAF(rs.getString("otherAF"));
/* 360 */         bo.setSDHAM(rs.getString("SDHAM"));
/* 361 */         bo.setPDHAM(rs.getString("PDHAM"));
/* 362 */         bo.setMicrowaveAM(rs.getString("microwaveAM"));
/* 363 */         bo.setOtherAM(rs.getString("otherAM"));
/* 364 */         bo.setVoltageA(rs.getString("voltageA"));
/* 365 */         bo.setPropertyA(rs.getString("propertyA"));
/* 366 */         bo.setOpentimeA(rs.getDate("opentimeA"));
/* 367 */         bo.setDistODFAF(rs.getString("distODFAF"));
/* 368 */         bo.setDistDDFAF(rs.getString("distDDFAF"));
/* 369 */         bo.setDistcomtankAF(rs.getString("distcomtankAF"));
/* 370 */         bo.setDistotherAF(rs.getString("distotherAF"));
/* 371 */         bo.setDistODFAM(rs.getString("distODFAM"));
/* 372 */         bo.setDistDDFAM(rs.getString("distDDFAM"));
/* 373 */         bo.setDistcomtankAM(rs.getString("distcomtankAM"));
/* 374 */         bo.setDistotherAM(rs.getString("distotherAM"));
/* 375 */         bo.setEle2MCNum(rs.getString("ele2MCNum"));
/* 376 */         bo.setEle2MUNum(rs.getString("ele2MUNum"));
/* 377 */         bo.setEle2MAUNum(rs.getString("ele2MAUNum"));
/* 378 */         bo.setEle2MUidx(rs.getString("ele2MUidx"));
/* 379 */         bo.setEle2MUTimeSlot(rs.getString("ele2MUTimeSlot"));
/* 380 */         bo.setMaintenance(rs.getString("maintenance"));
/* 381 */         bo.setRefreshtime(rs.getDate("refreshtime"));
/* 382 */         bo.setMemo(rs.getString("memo"));
/* 383 */         bo.setStr2MUseSta(rs.getString("2MUseSta"));
/* 384 */         bo.setIsPowerAlone(rs.getString("isPowerAlone"));
/* 385 */         bo.setMemo(rs.getString("memo"));
/* 386 */         list.add(bo);
/*     */       }
/*     */     }
/*     */     catch (Exception e) {
/* 390 */       e.printStackTrace();
/* 391 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 394 */       dbConClose();
/*     */     }
/* 396 */     return list;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getTransferscircuitBOList(Map condition)
/*     */   {
/* 403 */     ListContentsBFO bfo = new ListContentsBFO();
/* 404 */     int start = Integer.parseInt(condition.get("start").toString());
/* 405 */     int limit = Integer.parseInt(condition.get("limit").toString());
/* 406 */     String strTransferId = condition.get("TRANSFER_ID").toString();
/* 407 */     ResultSet rs = null;
/* 408 */     List list = new ArrayList();
/*     */     try
/*     */     {
/* 411 */       dbConInit();
/* 412 */       String strSQL = " select count(id) from transferscircuit where transfersid = '" + strTransferId + "' ";
/* 413 */       log.info(strSQL);
/* 414 */       rs = this.dbcon.execQuery(strSQL);
/* 415 */       if (rs.next()) {
/* 416 */         bfo.setTotalSize(rs.getInt(1));
/*     */       }
/* 418 */       strSQL = " select * from transferscircuit where transfersid ='" + strTransferId + "' limit " + start + ", " + limit;
/* 419 */       log.info(strSQL);
/* 420 */       rs = this.dbcon.execQuery(strSQL);
/* 421 */       while (rs.next()) {
/* 422 */         TransferscircuitBO bo = new TransferscircuitBO();
/* 423 */         bo.setId(rs.getString("id"));
/* 424 */         bo.setTransfersid(rs.getString("transfersid"));
/* 425 */         bo.setPortid(rs.getString("portid"));
/* 426 */         bo.setCfunction(rs.getString("cfunction"));
/* 427 */         list.add(bo);
/*     */       }
/* 429 */       bfo.setData(list.toArray());
/*     */     }
/*     */     catch (Exception e) {
/* 432 */       e.printStackTrace();
/* 433 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 436 */       dbConClose();
/*     */     }
/* 438 */     return bfo;
/*     */   }
/*     */ 
/*     */   public boolean saveTransferscircuitBO(TransferscircuitBO bo)
/*     */   {
/* 443 */     log.info("添加--传输【电路使用情况】---开始");
/* 444 */     boolean flag = true;
/*     */     try
/*     */     {
/* 447 */       dbConInit();
/* 448 */       StringBuffer sqlBuf = new StringBuffer();
/* 449 */       sqlBuf.append(" insert into transferscircuit ( transfersid,  portid, cfunction ) values (");
/* 450 */       sqlBuf.append(" '" + bo.getTransfersid() + "' ,");
/* 451 */       sqlBuf.append(" '" + bo.getPortid() + "' ,");
/* 452 */       sqlBuf.append(" '" + bo.getCfunction() + "' )");
/* 453 */       log.info(sqlBuf.toString());
/* 454 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 458 */       flag = false;
/* 459 */       e.printStackTrace();
/* 460 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 463 */       dbConClose();
/*     */     }
/* 465 */     log.info("添加--【电路使用情况】---结束");
/* 466 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean updateTransferscircuitBO(TransferscircuitBO bo)
/*     */   {
/* 471 */     log.info("更新--传输【电路使用情况：" + bo.getId() + "】---开始");
/* 472 */     boolean flag = true;
/*     */     try
/*     */     {
/* 475 */       dbConInit();
/* 476 */       StringBuffer sqlBuf = new StringBuffer();
/* 477 */       sqlBuf.append(" update transferscircuit  set ");
/* 478 */       sqlBuf.append(" portid = '" + bo.getPortid() + "' ,");
/* 479 */       sqlBuf.append(" cfunction = '" + bo.getCfunction() + "' ");
/* 480 */       sqlBuf.append(" where id = '" + bo.getId() + "'");
/* 481 */       log.info(sqlBuf.toString());
/* 482 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 486 */       flag = false;
/* 487 */       e.printStackTrace();
/* 488 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 491 */       dbConClose();
/*     */     }
/* 493 */     log.info("更新--【电路使用情况】---结束");
/* 494 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean deleteTransferscircuitBO(String strID)
/*     */   {
/* 499 */     log.info("删除--传输【电路使用情况：" + strID + "】---开始");
/* 500 */     boolean flag = true;
/*     */     try
/*     */     {
/* 503 */       dbConInit();
/* 504 */       StringBuffer sqlBuf = new StringBuffer();
/* 505 */       sqlBuf.append(" delete from  transferscircuit  ");
/* 506 */       sqlBuf.append(" where id = '" + strID + "'");
/* 507 */       log.info(sqlBuf.toString());
/* 508 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 512 */       flag = false;
/* 513 */       e.printStackTrace();
/* 514 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 517 */       dbConClose();
/*     */     }
/* 519 */     log.info("删除--【电路使用情况】---结束");
/* 520 */     return flag;
/*     */   }
/*     */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     com.yc.dao.station.TransfersDAO
 * JD-Core Version:    0.6.2
 */